package com.dsiab.manageService.mapper;

import com.dsiab.manageService.entity.AccountDto;
import com.dsiab.manageService.entity.PagesDto;
import com.dsiab.manageService.entity.SiteInfoDto;
import com.dsiab.manageService.entity.UserDto;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface AccountDao {

  public AccountDto getUserByname(String username);

  public UserDto getLimitedUserByname(String username);

  public boolean updateUserInfo(AccountDto accountDto);

  public List<Map> getRolesByUserName(String username);

  public List<UserDto> getUserList(int page);

  public List<Map> getRoleList();

  public void insertRole(@Param("username") String username,@Param("roleId") String roleId);

  public void insertDefaultCate(@Param("username") String username,@Param("cateName") String cateName,@Param("valid") int valid);

  public void deleteRolesByUsername(String username);

  public void insertUser(@Param("username") String username,@Param("password") String password,@Param("email") String email);

  public void deleUser(int id);

  public void deleUserRoles(String username);

  public Map getSiteInfo();

  public void updateSiteInfo(SiteInfoDto siteInfoDto);

  public void insertLoginLog(@Param("username") String username,@Param("ip") String ip,@Param("address") String address);

  public void setEmailValidteUrl(@Param("username") String username, @Param("email") String email,@Param("uid") String uid);

  public void getValidEmailEffective(String id);

  public PagesDto getDailySentence();

  public void addMemberPoints(@Param("username") String username, @Param("type") String type,  @Param("score") int score);

  public void updateMemberPoints(@Param("username") String username, @Param("score") int score);

  public void updatePwd(@Param("username") String username, @Param("newPwd") String newPwd);
}